package com.yunban.project.api.text_check.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yunban.project.api.text_check.domain.CorrectionDict;
import com.yunban.project.api.text_check.dto.CorrectionDictReq;
import com.yunban.project.api.text_check.dto.CorrectionDictResp;
import net.lab1024.sa.base.EventEnum;
import net.lab1024.sa.base.common.domain.PageParam;
import net.lab1024.sa.base.common.domain.PageResult;

import java.io.Serializable;
import java.util.List;

/**
 * @author: lijiajun
 * @date: 2024-11-21
 * @version: 1.0
 */
public interface CorrectionDictService extends IService<CorrectionDict> {

    PageResult<CorrectionDictResp> getDictList(PageParam req);

    /**
     * 添加纠错词典
     *
     * @param req 纠错词典请求参数
     * @return 是否添加成功
     */
    Boolean saveDict(CorrectionDictReq req);

    /**
     * 修改本地纠错词库
     *
     * @param req 词库参数
     * @return Boolean
     */
    Boolean updateDict(long id, CorrectionDictReq req);

    Boolean updateDictEnabled(Long id, EventEnum event);

    // 获取可以进行占位的词
    String sensitiveWordPlace(String word, boolean hasRestore);

    String localWordPlace(String text);

}
